import openslide
import numpy

#def generate_data():
slide = openslide.open_slide("data_origin/CatDog3.jpg")
s = slide.dimensions
s1 = (s[0] / 100) + 1
s2 = (s[1] / 100) + 1

k = 570
for i in range(s1):
    for j in range(s2):
        tile = slide.read_region((i * 100, j * 100), 0, (100, 100))
        tile.save("unlabel/%d.jpg" % k, format='JPEG')
        k += 1

# generate_data()




    


